/**
 * 
 */
package com.wordpress.sharebyblog.world.domain;

import java.io.Serializable;
import java.math.BigDecimal;


import java.util.List;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementRef;
import javax.xml.bind.annotation.XmlRootElement;

/**
 * @author Bharat Mehta
 *
 */

@XmlRootElement(name="country")
@XmlAccessorType(XmlAccessType.FIELD)
public class Country implements Serializable {

	@XmlElement
	@Id
	private String code;
	@XmlElement
	private String name;
	@XmlElement
	private String continent;
	@XmlElement
	private String region;
	@XmlElement
	private BigDecimal surfaceArea;
	@XmlElement
	private Integer indepYear;
	@XmlElement(name="countryPopulation")
	private BigDecimal population;
	@XmlElement
	private Float lifeExpectancy;
	@XmlElement
	private BigDecimal gnp;
	@XmlElement
	private BigDecimal gnpOld;
	@XmlElement
	private String localName;
	@XmlElement
	private String governmentForm;
	@XmlElement
	private String headOfState;
	@XmlElementRef(name="capital")
	@OneToMany
	private City capital;
	@XmlElement
	private String code2;
	
	
	/**
	 * @return the code
	 */
	public String getCode() {
		return code;
	}

	/**
	 * @param code the code to set
	 */
	public void setCode(String code) {
		this.code = code;
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @return the continent
	 */
	public String getContinent() {
		return continent;
	}

	/**
	 * @param continent the continent to set
	 */
	public void setContinent(String continent) {
		this.continent = continent;
	}

	/**
	 * @return the region
	 */
	public String getRegion() {
		return region;
	}

	/**
	 * @param region the region to set
	 */
	public void setRegion(String region) {
		this.region = region;
	}

	/**
	 * @return the surfaceArea
	 */
	public BigDecimal getSurfaceArea() {
		return surfaceArea;
	}

	/**
	 * @param surfaceArea the surfaceArea to set
	 */
	public void setSurfaceArea(BigDecimal surfaceArea) {
		this.surfaceArea = surfaceArea;
	}

	/**
	 * @return the indepYear
	 */
	public Integer getIndepYear() {
		return indepYear;
	}

	/**
	 * @param indepYear the indepYear to set
	 */
	public void setIndepYear(Integer indepYear) {
		this.indepYear = indepYear;
	}

	/**
	 * @return the population
	 */
	public BigDecimal getPopulation() {
		return population;
	}

	/**
	 * @param population the population to set
	 */
	public void setPopulation(BigDecimal population) {
		this.population = population;
	}

	/**
	 * @return the lifeExpectancy
	 */
	public Float getLifeExpectancy() {
		return lifeExpectancy;
	}

	/**
	 * @param lifeExpectancy the lifeExpectancy to set
	 */
	public void setLifeExpectancy(Float lifeExpectancy) {
		this.lifeExpectancy = lifeExpectancy;
	}

	/**
	 * @return the gnp
	 */
	public BigDecimal getGnp() {
		return gnp;
	}

	/**
	 * @param gnp the gnp to set
	 */
	public void setGnp(BigDecimal gnp) {
		this.gnp = gnp;
	}

	/**
	 * @return the gnpOld
	 */
	public BigDecimal getGnpOld() {
		return gnpOld;
	}

	/**
	 * @param gnpOld the gnpOld to set
	 */
	public void setGnpOld(BigDecimal gnpOld) {
		this.gnpOld = gnpOld;
	}

	/**
	 * @return the localName
	 */
	public String getLocalName() {
		return localName;
	}

	/**
	 * @param localName the localName to set
	 */
	public void setLocalName(String localName) {
		this.localName = localName;
	}

	/**
	 * @return the governmentForm
	 */
	public String getGovernmentForm() {
		return governmentForm;
	}

	/**
	 * @param governmentForm the governmentForm to set
	 */
	public void setGovernmentForm(String governmentForm) {
		this.governmentForm = governmentForm;
	}

	/**
	 * @return the headOfState
	 */
	public String getHeadOfState() {
		return headOfState;
	}

	/**
	 * @param headOfState the headOfState to set
	 */
	public void setHeadOfState(String headOfState) {
		this.headOfState = headOfState;
	}

	/**
	 * @return the capital
	 */
	public City getCapital() {
		return capital;
	}

	/**
	 * @param capital the capital to set
	 */
	public void setCapital(City capital) {
		this.capital = capital;
	}

	/**
	 * @return the code2
	 */
	public String getCode2() {
		return code2;
	}

	/**
	 * @param code2 the code2 to set
	 */
	public void setCode2(String code2) {
		this.code2 = code2;
	}

	

	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("Country [code=");
		builder.append(code);
		builder.append(", name=");
		builder.append(name);
		builder.append(", continent=");
		builder.append(continent);
		builder.append(", region=");
		builder.append(region);
		builder.append(", surfaceArea=");
		builder.append(surfaceArea);
		builder.append(", indepYear=");
		builder.append(indepYear);
		builder.append(", population=");
		builder.append(population);
		builder.append(", lifeExpectancy=");
		builder.append(lifeExpectancy);
		builder.append(", gnp=");
		builder.append(gnp);
		builder.append(", gnpOld=");
		builder.append(gnpOld);
		builder.append(", localName=");
		builder.append(localName);
		builder.append(", governmentForm=");
		builder.append(governmentForm);
		builder.append(", headOfState=");
		builder.append(headOfState);
		builder.append(", capital=");
		builder.append(capital);
		builder.append(", code2=");
		builder.append(code2);
		builder.append("]");
		return builder.toString();
	}
	
	
	
	
	
	
	
}
